package com.leyou.item.service.service;

import com.leyou.common.bean.PageResult;
import com.leyou.common.bean.Result;
import com.leyou.item.inter.dto.SpuPageDTO;
import com.leyou.item.inter.dto.SpuSaveDTO;
import com.leyou.item.inter.dto.SpuUpdateDTO;
import com.leyou.item.inter.pojo.Sku;
import com.leyou.item.inter.pojo.Spu;
import com.leyou.item.inter.pojo.SpuDetail;
import com.leyou.item.inter.vo.SkuLikeVO;
import com.leyou.item.inter.vo.SpuBoVO;

import java.util.List;

/**
 * @author zqq
 * @ClassName GoodsService
 * @Description: 商品相关的业务（包括SPU和SKU）
 * @date 2020/3/7-9:55
 */
public interface GoodsService {

    /**
     * @Title: querySpuBoByPage
     * @Description: 分页查询商品信息
     * @author: zqq
     * @param dto 参数类
     * @return: com.leyou.common.bean.PageResult<com.leyou.item.inter.vo.SpuSaveDTO>
     * @createTime: 2020-03-07 9:57
     * @version: v.1.0
     */
    Result<PageResult<SpuBoVO>> querySpuBoByPage(SpuPageDTO dto);

    /**
     * @Title: saveGoods
     * @Description: 新增商品，除了要对SPU新增以外，还要对SpuDetail、Sku、Stock进行保存
     * @author: zqq
     * @param dto
     * @return: com.leyou.common.bean.Result
     * @createTime: 2020-03-07 11:14
     * @version: v.1.0
     */
    Result saveGoods(SpuSaveDTO dto);

    /**
     * @Title: querySpuDetailBySpuId
     * @Description: 查询spu详情
     * @author: zqq
     * @param spuId
     * @return: com.leyou.common.bean.Result<com.leyou.item.inter.pojo.SpuDetail>
     * @createTime: 2020-03-07 11:39
     * @version: v.1.0
     */
    Result<SpuDetail> querySpuDetailBySpuId(Long spuId);

    /**
     * @Title: querySkusBySpuId
     * @Description: 根据spuid查询sku
     * @author: zqq
     * @param spuId
     * @return: com.leyou.common.bean.Result<java.util.List<com.leyou.item.inter.pojo.Sku>>
     * @createTime: 2020-03-07 11:55
     * @version: v.1.0
     */
    Result<List<Sku>> querySkusBySpuId(Long spuId,Boolean enable);

    /**
     * @Title: updateGoods
     * @Description: 修改商品
     * @author: zqq
     * @param dto 参数类
     * @return: com.leyou.common.bean.Result
     * @createTime: 2020-03-07 16:09
     * @version: v.1.0
     */
    Result updateGoods(SpuSaveDTO dto);

    /**
     * @Title: querySpuById
     * @Description: 根据spuid查询spu信息
     * @author: zqq
     * @param id spuid
     * @return: com.leyou.common.bean.Result<com.leyou.item.inter.pojo.Spu>
     * @createTime: 2020-03-09 14:08
     * @version: v.1.0
     */
    Result<Spu> querySpuById(Long id);

    /**
     * @Title: querySkuById
     * @Description: 根据skuid查询sku商品信息
     * @author: zqq
     * @param id skuid
     * @return: com.leyou.common.bean.Result<com.leyou.item.inter.pojo.Sku>
     * @createTime: 2020-03-10 15:14
     * @version: v.1.0
     */
    Result<Sku> querySkuById(Long id);

    /**
     * @Title: querySkuByLike
     * @Description: 随机查询sku
     * @author: zqq
     * @param num 要查询的条数
     * @return: com.leyou.common.bean.Result<com.leyou.item.inter.vo.SkuLikeVO>
     * @createTime: 2020-03-18 10:34
     * @version: v.1.0
     */
    Result<List<SkuLikeVO>> querySkuByLike(Integer num);

    /**
     * @Title: updateGoods
     * @Description: 控制商品上架或下架
     * @author: zqq
     * @param dto
     * @return: com.leyou.common.bean.Result
     * @createTime: 2020-03-21 14:58
     * @version: v.1.0
     */
    Result updateGoods(SpuUpdateDTO dto);

    /**
     * @Title: deleteGoods
     * @Description: 删除商品
     * @author: zqq
     * @param id 商品id
     * @return: com.leyou.common.bean.Result
     * @createTime: 2020-03-21 15:20
     * @version: v.1.0
     */
    Result deleteGoods(Long id);

}
